﻿using System;

namespace UtilityCalculators
{
    class Program
    {
        static void Main(string[] args)
        {
            Calculator calculator = new Calculator();
            
            Console.Write("请输入年份：");
            int year = int.Parse(Console.ReadLine());
            calculator.CheckLeapYear(year);
            
            Console.Write("\n请输入出行月份：");
            int month = int.Parse(Console.ReadLine());
            Console.Write("请输入交通方式（航班/动车）：");
            string transport = Console.ReadLine();
            calculator.CalculateTravelCost(month, transport);
            
            Console.ReadKey();
        }
    }
    
    class Calculator
    {
        public void CheckLeapYear(int year)
        {
            bool isLeapYear = (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
            textprint($"{year}年{(isLeapYear ? "是" : "不是")}闰年");
        }
        
        public void CalculateTravelCost(int month, string transport)
        {
            double basePrice = 8800;
            double discount = 1.0;
            
            if (month >= 5 && month <= 10)
            {
                if (transport.Equals("航班", StringComparison.OrdinalIgnoreCase))
                    discount = 0.9;
                else if (transport.Equals("动车", StringComparison.OrdinalIgnoreCase))
                    discount = 0.75;
            }
            else
            {
                if (transport.Equals("航班", StringComparison.OrdinalIgnoreCase))
                    discount = 0.6;
                else if (transport.Equals("动车", StringComparison.OrdinalIgnoreCase))
                    discount = 0.3;
            }
            
            double totalCost = basePrice * discount;
            textprint($"旅游费用计算结果：{totalCost:C}");
        }
        
        public void textprint(string message)
        {
            Console.WriteLine(message);
        }
    }
}
